package com.bkgy.controller.tbbxrecord.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bkgy.controller.tbbxrecord.entity.TbBxFileSave;
import com.bkgy.controller.tbbxrecord.service.ITbBxFileSaveService;
import com.bkgy.controller.tbbxrecord.dao.TbBxFileSaveDao;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TbBxFileSaveServiceImpl extends ServiceImpl<TbBxFileSaveDao, TbBxFileSave> implements ITbBxFileSaveService {
    @Override
    public List<TbBxFileSave> loadNewBxFileSaveData(int rowId) {
        //每次查询1000条记录
        Page<TbBxFileSave> p = new Page<>(1, 1000);
        QueryWrapper<TbBxFileSave> wrapper = new QueryWrapper<>();
        wrapper.lambda().select(TbBxFileSave::getIndocno, TbBxFileSave::getLine, TbBxFileSave::getMessage)
                .gt(TbBxFileSave::getIndocno, rowId)
                .eq(TbBxFileSave::getLine,"TCM2280")
                .orderByAsc(TbBxFileSave::getIndocno);

        return page(p, wrapper).getRecords();
    }
}
